/**
 * 此文件是用于配置自动import vue相关的函数，页面不需要再每个引入，如ref，onMounted等
 */
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";

export default function createAutoImport() {
  return [
    AutoImport({
      imports: ["vue", "vue-router", "pinia"],
      dts: false,
      resolvers: [ElementPlusResolver()], // 自动按需引入element组件
    }),
    Components({
      // 自动按需引入element组件
      resolvers: [ElementPlusResolver()],
    }),
  ];
}
